package com.jzk.cloudshop.portalgoodsapi.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.jzk.cloudshop.portalgoodsapi.remote.GoodsServiceRemote;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api("goods api")
@RestController
@RequestMapping("/goods")
class GoodsApiController {

	protected static final Logger logger = LoggerFactory.getLogger(HelloController.class);
	
	@Autowired
	private GoodsServiceRemote goodsServiceRemote;
		
	@ApiOperation(value="根据商品Id获取商品信息", notes="")
    @RequestMapping(value={"/{goodsId}"}, method=RequestMethod.GET)
    public String getGoodsById(@PathVariable(value = "goodsId") Long goodsId) {
        return goodsServiceRemote.getGoodsById(goodsId);
    }
}